function createEye (url) {
    var casePwdList = $('input[data-watch-pwd]') // $('.casePwd');
    var eyeshow = url + '/resource/lib/images/eye_show.png';
    var eyehide = url + '/resource/lib/images/eye_hide.png';
    var eyeStyle = 'display: inline-block;width: 18px;margin-top: 3px;'
    // console.log(casePwdList)
    function watchPwdFn () {
        // alert('aaa')
        var inp = $(this).prev().children('input');
        var type = inp.attr('type');
        var attrVal = inp.attr('data-watch-pwd')
        var str = eyeStyle
        if (type === 'password') {
            inp.attr('type', 'text');
            if (attrVal === 'login') {
                str += 'margin-top:7px;';
            } else {
                str += 'margin-top:5px;';
            }
        } else {
            inp.attr('type', 'password');
        }
        var mowType = type === 'password' ? 'text' : 'password';
        var data = eyeIcon(mowType)
        var img = '<img style="' + str + '" src="' + data.img+ '" />'
        $(this).html(img)
    }
    for (var i = 0; i < casePwdList.length; i++) {
        (function (i) {
            var item = casePwdList[i];
            var dom = document.createElement('span');
            var style = '';
            var attrVal = $(item).attr('data-watch-pwd');
            if (attrVal === 'login') {
                style = 'z-index: 10;position: relative;top: -28px;line-height: 28px;left: 80%;'
            }

            var type = $(item).attr('type');
            var data = eyeIcon(type)
            var img = '<img style="' + eyeStyle + '" src="' + data.img + '" />'
            dom.style.cssText = style + 'cursor: pointer; padding: 0 4px;';
            dom.innerHTML = img;
            dom.addEventListener('mousedown', watchPwdFn);
            dom.addEventListener('mouseup', watchPwdFn);
            $(item).after(dom);
        })(i)
    }

    function eyeIcon (type) {
        var data = {
            img: '',
            type: 'password'
        }
        if (type === 'password') {
            data.type = 'text'
            data.img = eyehide
        } else {
            data.type = 'password'
            data.img = eyeshow
        }
        return data
    }
}